import request from '@/utils/request'

export function login(data) {
  console.log(data)
  // console.log('login')
  return request({
    baseURL: process.env.VUE_APP_BASE_API1,
    url: '/api/login/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    baseURL: process.env.VUE_APP_BASE_API1,
    url: '/api/user/info',
    method: 'get',
    params: { token }
  })
}

export function getUserList(queryParam) {
  return request({
    baseURL: process.env.VUE_APP_BASE_API1,
    url: '/api/user/list',
    method: 'get',
    params: queryParam
  })
}

export function getUser(userId) {
  return request({
    baseURL: process.env.VUE_APP_BASE_API1,
    url: '/api/user/getuser',
    method: 'get',
    params: { userId }
  })
}

export function logout() {
  return request({
    baseURL: process.env.VUE_APP_BASE_API1,
    url: '/api/login/logout',
    method: 'post'
  })
}

export function getAuthMenu(token) {
  return request({
    url: '/dashboard',
    method: 'get',
    params: { token }
  })
}
